package com.androidhive.androidlistview;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.telephony.SmsManager;
import android.util.Log;
import android.view.Menu;

public class Gsms extends Activity {
	DatabaseHandler db=new DatabaseHandler(this);

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_gsms);
		 Intent intent = getIntent();
		    String a1 = intent.getStringExtra(LoginActivity.EXTRA_MESSAGE1);
		    String a2 = intent.getStringExtra(LoginActivity.EXTRA_MESSAGE2);
		    String a3 = intent.getStringExtra(LoginActivity.EXTRA_MESSAGE3);
		    String a4 = intent.getStringExtra(LoginActivity.EXTRA_MESSAGE4);
		    Log.d("abpls",a1+a2+a3+a4);
		    int A1,A2,A3,A4;
		    A1=Integer.parseInt(a1);
		    A2=Integer.parseInt(a2);
		    A3=Integer.parseInt(a3);
		    A4=Integer.parseInt(a4);
		  String msg=  db.sendSmsToFarmer(A1,A2,A3,A4);
		    SmsManager sms = SmsManager.getDefault();
		   // sms.sendTextMessage("9035823436", null, msg, null, null); 
		    
		    
		// Show the Up button in the action bar.
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_gsms, menu);
		return true;
	}

	
	

}
